import { request } from '../../utils/index.js';
import { Api } from '../../config/api.js';

var appInst = getApp();

Page({
  data: {
    host: appInst.globalData.host,
    progressPercent: '40%',
    good: null
  },
  onLoad: function (options) {
    this.getGoodDetails(options.goodid);
  },
  getGoodDetails(goodid) {
    request({
      url: "https://yyqxpt.com/v1/goods/goodsDetails",
      data: { id: goodid },
      method: 'POST'
    })
      .then(res => {
        if (res.length > 0) {
          this.setData({ good: res[0] })
        }
      })
      .catch(err => { });
  }
});
